package com.car.util;

import java.io.Serializable;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;

import com.car.dal.object.TgUser;

/**
 * freemarker 静态方法库 可以直接在freemark中调用 date 2012-4-21 Company taobao
 * 
 * @author Figo
 * @version 1.0
 * 
 */
public class WebUtil implements Serializable {
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -4515073604928841057L;
	private Logger log = Logger.getLogger(WebUtil.class);
	
	/**
	 * 获取cookie信息,
	 */
	public static TgUser getCookieUser() {
		TgUser user = UserUtil.getUserFromCookies();
		return user != null ? user : null;
	}
	/**
	 * 获取name
	 */
	public static String getName() {
		TgUser user = UserUtil.getUserFromCookies();
		return user != null ? (user.getUsername() != null ? user.getUsername()
				: user.getUsername()) : "";
	}
	/**
	 * 获取cookie信息,
	 */
	public static HttpServletRequest getRequest() {
		return UserUtil.getRequest();
	}

	


	
}
